home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / snz128s / src / testmall.h < prev    next >
Text File  |  1994-04-13  |  2KB  |  50 lines

  1. /*******************************************************************************
  2. * Module       : TESTMALL.H                                                    *
  3. *------------------------------------------------------------------------------*
  4. * Program      : DEBUG UTILITY                                                 *
  5. *------------------------------------------------------------------------------*
  6. * Author       : M.R.Watson.    (maff@cix)                                     *
  7. *------------------------------------------------------------------------------*
  8. * Version      : 1.0                                                           *
  9. *------------------------------------------------------------------------------*
  10. * Legal Status : Public Domain.                                                *
  11. *------------------------------------------------------------------------------*
  12. * Last Updated : 05/07/92                                                      *
  13. *==============================================================================*
  14. * #include this module in any sources where you want to check the mallocs etc. *
  15. * You will need to link with the "TESTMALL.C" module, and                      *
  16. * set extern int DebugMalloc to TRUE.                                          *
  17. *******************************************************************************/
  18.  
  19. #if !defined(__TESTMALL_H)
  20.  
  21.     #define __TESTMALL_H
  22.  
  23. #if    defined (DBG_MALLOC)
  24.  
  25.     #define malloc(x)        mymalloc((unsigned)(x),__FILE__,__LINE__)
  26.     #define calloc(x,y)      mycalloc((unsigned)(x),(int)(y),__FILE__,__LINE__)
  27.     #define free(x)          myfree((unsigned char *)(x),__FILE__,__LINE__)
  28.     #define chmall(x)        CheckMalloc((char*)(x),__FILE__,__LINE__)
  29.     #define chfree()         CheckFree(__FILE__,__LINE__)
  30.     #define testmall(f)      TestMalloc(f,__FILE__,__LINE__)
  31.  
  32.     void CheckMalloc( char *p, char *filename, int linenum );
  33.     void myfree( unsigned char *p, char *filename, int linenum );
  34.     void *mycalloc( size_t size, int count, char *filename, int linenum );
  35.     void *mymalloc( size_t size, char *filename, int linenum );
  36.     void TestMalloc( int blocks, char *filename, int linenum );
  37.     void CheckFree( char *file, int line );
  38.     void SetOverlap( int over );
  39.     void SetDebugMallocLevel( int level );
  40.     void mem_report (void);
  41.  
  42. #else
  43.  
  44. #define    malloc(x)            xmalloc(x)
  45.  
  46. #endif
  47.  
  48. #endif
  49.  
  50.